package main

import (
	"astgram/handler"
	"astgram/middleware"
	"github.com/gin-gonic/gin"
)

func register(r *gin.Engine) {
	r.Use(middleware.Cors())
	r.GET("/img_share/api/ping", handler.Ping)

	// 登陆注册
	r.POST("/img_share/api/reg", handler.Reg)
	r.POST("/img_share/api/login", handler.Login)

	r.GET("/img_share/api/images", handler.GetImages)

	// 上传图片
	r.POST("/img_share/api/upload_image", handler.UploadImage)

	r.POST("/img_share/api/comment", handler.CreateComment)
}
